1 00:00:00,230 --> 00:00:06,410 I'm going to do the buy properties in its own game and then I'm going to use the exact same style so 2 00:00:06,410 --> 00:00:09,650 that it'll be easy to integrate into our other game if you want. 3 00:00:09,650 --> 00:00:13,520 But you might want to just take this and put it into your own game. 4 00:00:13,520 --> 00:00:15,740 So I figured I'd break that code out. 5 00:00:16,460 --> 00:00:18,840 So this is an empty terrain right here. 6 00:00:18,860 --> 00:00:20,180 There's nothing in it. 7 00:00:20,180 --> 00:00:24,470 But I did give you guys some starter files, two of them. 8 00:00:24,470 --> 00:00:28,550 I uploaded it to the resources section of this lecture. 9 00:00:28,580 --> 00:00:30,170 Go ahead and download that. 10 00:00:30,170 --> 00:00:35,240 It's called Property Scripts Managers, and it's a rbcm file. 11 00:00:35,240 --> 00:00:37,160 I saved it off as a model. 12 00:00:37,310 --> 00:00:39,920 And then go to your server script service. 13 00:00:39,920 --> 00:00:45,740 Remember where you downloaded it to because we're going to right click insert from file and then you're 14 00:00:45,740 --> 00:00:47,330 going to look for it on your computer. 15 00:00:47,330 --> 00:00:48,770 Mine's queued up, right? 16 00:00:48,770 --> 00:00:57,020 Because this is a video, so I'm going to get my property scripts managers, rbcm and I open it up and 17 00:00:57,020 --> 00:01:04,280 I saved it off as a model because this is a module script and if I would have saved it off and uploaded 18 00:01:04,280 --> 00:01:06,410 it, you would have got it as a regular script. 19 00:01:06,650 --> 00:01:09,200 But we want a module script. 20 00:01:09,290 --> 00:01:14,840 Let's just drag our game manager into server script service and then our property manager, which is 21 00:01:14,840 --> 00:01:22,590 the module script in the server script service, and I'm going to get rid of that, that, that model. 22 00:01:22,800 --> 00:01:26,160 All right, So now we have both of these scripts. 23 00:01:26,160 --> 00:01:34,110 If you open property manager and you recall from your equipment manager, I used almost identical format 24 00:01:34,110 --> 00:01:37,800 and I put notes in here so that you could follow along, right? 25 00:01:37,800 --> 00:01:42,660 So if you were putting this into a game, you're going to put your finished property manager into that 26 00:01:42,660 --> 00:01:43,320 game. 27 00:01:43,320 --> 00:01:46,710 You shouldn't need to touch property manager at all. 28 00:01:47,040 --> 00:01:53,490 Game manager is very similar to the one that we've been working on in our other game, in our zombie 29 00:01:53,520 --> 00:01:56,970 game, and I even called it all the same stuff. 30 00:01:56,970 --> 00:01:59,400 I basically just deleted the stuff I didn't need. 31 00:01:59,430 --> 00:02:03,150 If you look right here, you're going to see we have a data store. 32 00:02:03,180 --> 00:02:03,590 Uh oh. 33 00:02:03,600 --> 00:02:04,740 What does that mean? 34 00:02:04,980 --> 00:02:06,390 Let's go to home. 35 00:02:07,110 --> 00:02:10,280 Game settings you might have to save your game off. 36 00:02:10,290 --> 00:02:11,800 Mine is already saved off. 37 00:02:11,820 --> 00:02:13,530 Then go to security. 38 00:02:13,530 --> 00:02:17,040 Enable studio access to API services. 39 00:02:17,040 --> 00:02:18,000 There we go. 40 00:02:18,000 --> 00:02:20,100 And we're going to save it, right? 41 00:02:20,100 --> 00:02:25,200 And if you scroll through this, you're going to see that this has all the same functions, right? 42 00:02:25,200 --> 00:02:27,540 I did modify them and I put some notes in here. 43 00:02:27,540 --> 00:02:28,110 Right. 44 00:02:28,140 --> 00:02:30,270 Give player the property. 45 00:02:30,690 --> 00:02:36,360 We don't have any of our daily streak stuff in here, but you could see where it would all go. 46 00:02:36,720 --> 00:02:40,320 Let's go over to our scene and set up some lot stuff. 47 00:02:40,320 --> 00:02:42,930 So I am at the home tab. 48 00:02:42,930 --> 00:02:46,560 Let's go to model and then add a spawn location. 49 00:02:46,560 --> 00:02:48,990 I'm going to put this in the center of the world for now. 50 00:02:48,990 --> 00:02:52,890 So my spawn location is location is at. 51 00:02:52,890 --> 00:02:54,240 Oh man, it's pretty far away. 52 00:02:54,270 --> 00:03:01,710 I'm going to make it zero on the x 10.5 and the Y, that's for the terrain and then zero on the Z. 53 00:03:03,090 --> 00:03:03,900 All right. 54 00:03:03,930 --> 00:03:04,920 Where is it at? 55 00:03:04,950 --> 00:03:06,690 Way over there. 56 00:03:06,690 --> 00:03:09,000 I hit my F button and I framed in. 57 00:03:09,150 --> 00:03:11,100 Now I need to get a lot. 58 00:03:12,360 --> 00:03:13,590 Let's just add one lot. 59 00:03:13,620 --> 00:03:14,340 We'll get the lot. 60 00:03:14,370 --> 00:03:15,270 The way we want it. 61 00:03:15,270 --> 00:03:16,920 And then we'll make more of them. 62 00:03:17,070 --> 00:03:17,330 Right. 63 00:03:17,340 --> 00:03:18,620 So let's get a lot here. 64 00:03:18,630 --> 00:03:19,740 We'll call that lot. 65 00:03:19,770 --> 00:03:20,760 It's a part. 66 00:03:21,060 --> 00:03:23,880 Call it lot and let's change the size. 67 00:03:23,880 --> 00:03:30,210 So the size of the lot will be about 50 by one. 68 00:03:30,210 --> 00:03:31,620 By 50. 69 00:03:32,590 --> 00:03:39,520 And let's position it and I want to position them equidistant from my spawn location just so they all 70 00:03:39,520 --> 00:03:43,480 look kind of the same when you get in the game, because we're going to swap those lots out depending 71 00:03:43,480 --> 00:03:44,560 on who's in the game. 72 00:03:44,560 --> 00:03:47,110 Can't just keep making more lots for more players. 73 00:03:47,110 --> 00:03:49,930 You might get somebody who buys a lot and never comes back. 74 00:03:49,930 --> 00:03:58,750 So for position, I think I'll make that 110.5 because we want the terrain, height and then zero on 75 00:03:58,750 --> 00:03:59,560 the Z. 76 00:04:00,640 --> 00:04:01,510 Nice. 77 00:04:01,510 --> 00:04:03,580 And we got to get rid of those blades. 78 00:04:03,580 --> 00:04:05,170 That doesn't look very good. 79 00:04:05,350 --> 00:04:15,580 I'll go to home and then editor edit paint, maybe hit ground and I'm not going to bother adjusting 80 00:04:15,580 --> 00:04:15,910 anything. 81 00:04:15,910 --> 00:04:17,110 I'm just going to eyeball it. 82 00:04:17,110 --> 00:04:23,170 You can spend as much time on this as you want, but the videos got to be kind of short or you'll get 83 00:04:23,170 --> 00:04:26,770 bored because I get bored when I watch long videos. 84 00:04:26,800 --> 00:04:27,100 All right. 85 00:04:27,100 --> 00:04:28,270 That's going to be good enough. 86 00:04:29,230 --> 00:04:30,940 Yeah, fine. 87 00:04:30,970 --> 00:04:31,910 Oh, my gosh. 88 00:04:31,910 --> 00:04:32,870 I can't stop. 89 00:04:33,350 --> 00:04:34,520 All right, now it's done. 90 00:04:34,520 --> 00:04:36,020 All right, let's get rid of this. 91 00:04:36,020 --> 00:04:40,400 And I want to make this into a model so the lots just apart. 92 00:04:40,430 --> 00:04:41,570 Let's right click. 93 00:04:41,600 --> 00:04:44,810 And now we'll go group as model. 94 00:04:44,810 --> 00:04:48,930 And I'm going to call this player lot, right? 95 00:04:49,280 --> 00:04:50,540 So that's the lot level. 96 00:04:50,540 --> 00:04:52,250 We're going to put a few things in that lot. 97 00:04:52,280 --> 00:04:56,540 We are going to need a tag for the owner. 98 00:04:56,540 --> 00:05:03,140 So I'm going to hit this plus and I'm going to use a string value for just the owner name. 99 00:05:03,140 --> 00:05:08,270 Some people put the hole, they use an object value and they put the whole player value in there. 100 00:05:08,270 --> 00:05:09,680 But I think I'll just use the name. 101 00:05:09,680 --> 00:05:14,770 So for the string value, I'm going to call that owner, right? 102 00:05:14,780 --> 00:05:16,250 So string value right there. 103 00:05:16,280 --> 00:05:16,520 Okay. 104 00:05:16,700 --> 00:05:17,690 In case you missed it. 105 00:05:17,750 --> 00:05:19,250 All right, now let's get a price. 106 00:05:19,250 --> 00:05:20,600 So hit the plus sign again. 107 00:05:20,600 --> 00:05:22,550 That's going to be an int value. 108 00:05:23,280 --> 00:05:30,630 In value and I'll say price and we can actually add the price, let's say 5000. 109 00:05:30,630 --> 00:05:36,450 So we'll do 5000, whatever, whatever metric you're using, we're using points, but we want to keep 110 00:05:36,450 --> 00:05:41,460 this one empty because we're going to use code for that, whether they buy it or whether they enter 111 00:05:41,460 --> 00:05:41,940 the game. 112 00:05:41,940 --> 00:05:43,320 And we assign them a lot. 113 00:05:43,530 --> 00:05:44,780 What else do we need? 114 00:05:44,790 --> 00:05:47,340 Maybe some signs saying for sale. 115 00:05:47,340 --> 00:05:54,420 And I put a sign in the resources, the one for the landmines, in case you don't have it. 116 00:05:54,420 --> 00:05:56,100 If you don't have it, you can add it. 117 00:05:56,100 --> 00:05:57,510 So just download it. 118 00:05:57,540 --> 00:06:02,670 We'll right click and then insert from file. 119 00:06:03,710 --> 00:06:08,180 And it should be called sign as the landmine sign from that video. 120 00:06:08,210 --> 00:06:10,940 It's going to be like, who knows where in the world, though? 121 00:06:10,940 --> 00:06:16,430 So I'm going to pause the video while I drag it way over there because I'm sure you don't want to watch 122 00:06:16,430 --> 00:06:17,360 me do that. 123 00:06:18,440 --> 00:06:18,620 All right. 124 00:06:18,620 --> 00:06:20,210 So we got our sign right here. 125 00:06:20,210 --> 00:06:22,190 It still says caution landmine. 126 00:06:22,190 --> 00:06:23,830 And this says landmine. 127 00:06:23,840 --> 00:06:25,160 Put it in your. 128 00:06:25,430 --> 00:06:32,650 Your player lot model though and then change the name to for sale sign or something like that sale sign 129 00:06:32,660 --> 00:06:33,500 I'll do for sale. 130 00:06:33,500 --> 00:06:35,180 Sign for sale sign. 131 00:06:35,180 --> 00:06:35,480 All right. 132 00:06:35,480 --> 00:06:37,820 And then under sign we have some text. 133 00:06:37,820 --> 00:06:42,290 Open that up, surface gooey, open that up text label. 134 00:06:42,740 --> 00:06:50,540 Let's scroll down to where it says Caution minefield and we'll change it to for sale. 135 00:06:50,900 --> 00:06:51,560 All right. 136 00:06:51,560 --> 00:06:56,780 And on this sign right here on one of the parts, you can do it post or sign. 137 00:06:56,780 --> 00:06:58,970 Let's add a proximity prompt. 138 00:06:59,000 --> 00:07:00,350 Hit the plus. 139 00:07:01,600 --> 00:07:02,750 Proximity prompt. 140 00:07:02,800 --> 00:07:05,500 And that way when somebody goes up, we're going to turn it on and off. 141 00:07:05,500 --> 00:07:07,510 If somebody owns it, it's not going to pop up. 142 00:07:07,510 --> 00:07:13,180 But if somebody doesn't own the property, we want this to pop up and say, you know, by a lot, you 143 00:07:13,180 --> 00:07:14,170 know, as a question. 144 00:07:14,170 --> 00:07:16,630 So I'll say by prompt. 145 00:07:17,890 --> 00:07:18,850 All right, what else do we need? 146 00:07:18,850 --> 00:07:20,250 Let's add one more thing. 147 00:07:20,260 --> 00:07:24,310 Player lot plus sign script. 148 00:07:24,460 --> 00:07:25,750 We'll call this script. 149 00:07:28,200 --> 00:07:30,570 By script. 150 00:07:31,230 --> 00:07:32,370 We're going to do more than by a lot. 151 00:07:32,400 --> 00:07:35,760 We're going to buy houses and parts and fence and stuff like that. 152 00:07:36,000 --> 00:07:36,300 All right. 153 00:07:36,300 --> 00:07:37,340 That's looking pretty good. 154 00:07:37,350 --> 00:07:39,960 In the next video, we're going to start doing some coding.